package com.wjv.example.controller;

import com.wjv.example.common.entity.ResultInfo;
import com.wjv.example.service.PaymentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * <p>Title: PaymentController</p>
 * <p>Company:misspao </p>
 *
 * @author: wjv
 * @Date: Create in 15:20 2020/9/21
 * @Description:
 */
@RestController
@RequestMapping("/payment")
public class PaymentController {
    private static final Logger logger = LoggerFactory.getLogger(PaymentController.class);
    @Autowired
    private PaymentService paymentService;

    @GetMapping("/getPayment")
    public ResultInfo getPayment(int id) {
        logger.info("**************" + LocalDateTime.now().toString());
        return paymentService.getPayment(id);
    }

    @PostMapping("/save")
    public ResultInfo save() {
        return paymentService.save();
    }
}
